/*
 * BuildCommand.cpp
 *
 *  Created on: Oct 14, 2008
 *      Author: Ryan
 */

#include "BuildCommand.h"

#include <sstream>

namespace OOInterface
{

BuildCommand::BuildCommand( ConstUnitPtr unit, const Point3f& location, const Direction& facing ) :
	_unit( unit ), _location( location ), _orientation( facing )
{
}

BuildCommand::~BuildCommand()
{
}

void BuildCommand::setUnit( ConstUnitPtr unit)
{
	_unit = unit;
}

ConstUnitPtr BuildCommand::getUnit() const
{
	return _unit;
}

void BuildCommand::setLocation( const Point3f& pos )
{
	_location = pos;
}

const Point3f& BuildCommand::getLocation() const
{
	return _location;
}

void BuildCommand::setDirection( const Direction& facing )
{
	_orientation = facing;
}

const Direction& BuildCommand::getDirection() const
{
	return _orientation;
}

std::string BuildCommand::toString() const
{
	std::stringstream ss;
	ss << "BuildCommand: " << _unit->getName() << " Location: (" << _location.getX() << "," << _location.getY() << "," << _location.getZ() << ")";

	return ss.str();
}

}
